﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Resources;
using System.Reflection;
using BusinessCommon.Utilities;

namespace BusinessCommon.Utilities
{
    public class ResxManagerString
    {
        private static String DOT = ".";
        static CultureInfo culture = CultureInfo.CurrentCulture;
        ResourceManager rmCommon = new ResourceManager("StoreWinform.MultiLang.Common", Assembly.GetExecutingAssembly());

        /// <summary>
        /// Lấy ra chuỗi property cho multilang các hạng mục
        /// </summary>
        /// <param name="FormName">Tên màn hình</param>
        /// <param name="KeyResource">Tên hạng mục</param>
        /// <returns>Chuỗi property</returns>
        public static String GetPropertyString(string FormName, string KeyResource)
        {
            culture = CultureInfo.CreateSpecificCulture("vi-VN");
            ResourceManager rm = new
                ResourceManager(CommonString.LOCALIZE_FOLDER + DOT + FormName, Assembly.GetExecutingAssembly());
            return rm.GetString(KeyResource, culture);
        }


    }
}
